#ifndef UTILS_H_
#define UTILS_H_

#include <cstring>

using namespace std;


/* Here are user defined options */

#define ALL_ANSWERS 0 		// give all answers

#define KADANE_OPTIMIZED 1	// the final Kadane implementation
#define KADANE_2D 0		// the less optimized Kadane
#define DIVIDE_CONQUER 0	// the D&C which is bad
#define BAE 0			// the prefix sum

#define KADANE_BLOCK 0		// in case we had to use block of matrix D&C and // computing
#define KADANE_VECT 0		// 1D storage

#define DISPLAY 0		// display informations
#define DISPLAY_TIME 0		// display time executions

/* User defined options end */


// Defines dynamic max size allocation for MxN matrix
#define MAX_ORDER 63

// Dimension space not used yet
#define DIM 1

// OpenMP size of chunk for static
#define CHUNK_FACTOR 20

#define	MAX_SIZE 65535

/*!
 *  \def MAX(X,Y)
 *  Max between \a X et \a Y
 */
#ifndef MAX
#define	MAX(X, Y) ( X > Y ? X : Y)
#endif

/*!
 *  \def MIN(X,Y)
 *  Min between \a X et \a Y
 */
#ifndef MIN
#define	MIN(X, Y) ( X < Y ? X : Y)
#endif

/*!
 *  \def ABS(X)
 *  Absolute value of \a X
 */
#define	ABS(X) (X >= 0 ? X:(-X))

#ifndef INFINITY
# define INFINITY	1.0e5
#endif

static const char usage[] = "\
Usage :\n\
run [Number of cores] [Input1 [Input2]  ...]\n\
./run 40 input1.txt input2.txt input3.txt > output.txt\n\
";	/*!< Usage */


// not used anymore
//static const string INPUT_PATH = "input/";

template <class T>
class Utils
{
	public:
		inline static const T& max(const T& a, const T& b);
};

template <class T>
inline const T& Utils<T>::max(const T& a, const T& b)
{
	return (b < a) ? a : b;
}


#endif /* UTILS_H_ */

